<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


    <script>
        var person = {"name": "张三", age: 23, 'gender': true};
        //获取name的值

        var ps = [
            {"name": "张三", age: 23, 'gender': true},
            {"name": "张2", age: 43, 'gender': false},
            {"name": "张3", age: 41, 'gender': true}
        ];

        /* for(var key in person){
           alert(key);
           //会弹出所有的键的名称
         }*/
        for (var i = 0; i < ps.length; i++) {
            var p = ps[i];
            for (var key in p) {
                document.write("key : " + key + "==" + p[key]);
            }
        }
    </script>
</head>
<body>

</body>
</html>